#include "stdafx.h"
#include "DynamicRenderer.h"
DynamicRenderer::DynamicRenderer()
{
}


DynamicRenderer::~DynamicRenderer()
{

}

bool DynamicRenderer::Init(int w, int h)
{
	m_nWidth = w;
	m_nHeight = h;
	m_nXCoord = m_nYCoord = 0;
	bShow = false;
	return true;
}

void DynamicRenderer::Show(bool show)
{
	bShow = show;
	if (!bShow)
		stroke.Clear();
}

void DynamicRenderer::UpdateData(int x, int y)
{
	m_nXCoord = x;
	m_nYCoord = y;
	stroke.Add(StylusPoint(x, y));
}

void DynamicRenderer::Draw(sf::RenderTarget& target, sf::RenderStates state)
{
	if (bShow)
	{
		stroke.Draw(target, state);
	}
}


